// Copyright (c) 2024，D-Robotics.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/***************************************************************************
* COPYRIGHT NOTICE
* Copyright 2019 Horizon Robotics, Inc.
* All rights reserved.
***************************************************************************/
#ifndef UTILITY_SENSOR_INC_SC132GS_SETTING_H_
#define UTILITY_SENSOR_INC_SC132GS_SETTING_H_

#ifdef __cplusplus
extern "C" {
#endif
#define TRIGGER
#define WIDTH 1088

static uint32_t sc132gs_linear_init_1088x1280_30fps_setting[] = {
	0x0103,0x01,
	0x0100,0x00,
	0x36e9,0x80,
	0x36f9,0x80,
	0x3018,0x12,
	0x3019,0x0e,
	0x301a,0xb4,
	0x301f,0x45,
	0x3032,0x60,
	0x3038,0x44,
	0x3207,0x17,
#ifdef WIDTH
	0x3208,0x04,
	0x3209,0x40,
	0x320a,0x05,
	0x320b,0x00,
	0x3210,0x00,
	0x3211,0x0a,
	0x3212,0x00,
	0x3213,0x0a,
#endif
	0x320c,0x02,
	0x320d,0xee,
	0x320e,0x05,
	0x320f,0x78,
	0x3250,0xcc,
	0x3251,0x02,
	0x3252,0x05,
	0x3253,0x73,
	0x3254,0x05,
	0x3255,0x3b,
	0x3306,0x78,
	0x330a,0x00,
	0x330b,0xc8,
	0x330f,0x24,
	0x3314,0x80,
	0x3315,0x40,
	0x3317,0xf0,
	0x331f,0x12,
	0x3364,0x00,
	0x3385,0x41,
	0x3387,0x41,
	0x3389,0x09,
	0x33ab,0x00,
	0x33ac,0x00,
	0x33b1,0x03,
	0x33b2,0x12,
	0x33f8,0x02,
	0x33fa,0x01,
	0x3409,0x08,
	0x34f0,0xc0,
	0x34f1,0x20,
	0x34f2,0x03,
	0x3622,0xf5,
	0x3630,0x5c,
	0x3631,0x80,
	0x3632,0xc8,
	0x3633,0x32,
	0x3638,0x2a,
	0x3639,0x07,
	0x363b,0x48,
	0x363c,0x83,
	0x363d,0x10,
	0x36ea,0x37,
	0x36eb,0x04,
	0x36ec,0x03,
	0x36ed,0x24,
	0x36fa,0x2b,
	0x36fb,0x0b,
	0x36fc,0x01,
	0x36fd,0x34,
	0x3900,0x11,
	0x3901,0x05,
	0x3902,0xc5,
	0x3904,0x04,
	0x3908,0x91,
	0x391e,0x00,
	0x3e01,0x57,
	0x3e02,0x00,
	0x3e09,0x20,
	0x3e0e,0xd2,
	0x3e14,0xb0,
	0x3e1e,0x7c,
	0x3e26,0x20,
	0x4418,0x38,
	0x4503,0x10,
	0x4837,0x0f,
	0x5000,0x0e,
	0x540c,0x51,
	0x550f,0x38,
	0x5780,0x67,
	0x5784,0x10,
	0x5785,0x06,
	0x5787,0x02,
	0x5788,0x00,
	0x5789,0x00,
	0x578a,0x02,
	0x578b,0x00,
	0x578c,0x00,
	0x5790,0x00,
	0x5791,0x00,
	0x5792,0x00,
	0x5793,0x00,
	0x5794,0x00,
	0x5795,0x00,
	0x5799,0x04,
#ifdef TRIGGER
	//singel frame slave 
	0x3222,0x02,
	0x3223,0x48,
	0x3226,0x08,
	0x3227,0x08,
	0x3217,0x00,
	0x3218,0x00,
	0x322b,0x0b,
	0x320e,0x3f,
	0x320f,0xff,
	0x3225,0x04,
	0x300a,0x62,
#endif
	//exp 10ms
	0x3e01,0x32,
	0x3e02,0x80,

	0x36e9,0x24,
	0x36f9,0x50,
	//0x0100,0x01,
};

static uint32_t sc132gs_linear_init_896x896_10fps_setting[] = {
	0x0103,0x01,
	0x0100,0x00,
	0x36e9,0x80,
	0x36f9,0x80,
	0x3018,0x32,
	0x3019,0x0c,
	0x301a,0xb4,
	0x301f,0x42,
	0x3032,0x60,
	0x3038,0x44,
	//0x3200,0x00,
	//0x3201,0x28,
	//0x3202,0x00,
	//0x3203,0x08,
	//0x3204,0x04,
	//0x3205,0x2f,
	//0x3206,0x05,
	0x3207,0x17,
	//0x3208,0x04,
	//0x3209,0x00,
	//0x320a,0x05,
	//0x320b,0x00,
	0x320c,0x02,
	0x320d,0xee,
	0x320e,0x05,
	0x320f,0x78,
	//0x3210,0x00,
	//0x3211,0x04,
	//0x3212,0x00,
	//0x3213,0x04,
	0x3250,0xcc,
	0x3251,0x02,
	0x3252,0x05,
	0x3253,0x73,
	0x3254,0x05,
	0x3255,0x3b,
	0x3306,0x78,
	0x330a,0x00,
	0x330b,0xc8,
	0x330f,0x24,
	0x3314,0x80,
	0x3315,0x40,
	0x3317,0xf0,
	0x331f,0x12,
	0x3364,0x00,
	0x3385,0x41,
	0x3387,0x41,
	0x3389,0x09,
	0x33ab,0x00,
	0x33ac,0x00,
	0x33b1,0x03,
	0x33b2,0x12,
	0x33f8,0x02,
	0x33fa,0x01,
	0x3409,0x08,
	0x34f0,0xc0,
	0x34f1,0x20,
	0x34f2,0x03,
	0x3622,0xf5,
	0x3630,0x5c,
	0x3631,0x80,
	0x3632,0xc8,
	0x3633,0x32,
	0x3638,0x2a,
	0x3639,0x07,
	0x363b,0x48,
	0x363c,0x83,
	0x363d,0x10,
	0x36ea,0x36,
	0x36eb,0x04,
	0x36ec,0x03,
	0x36ed,0x24,
	0x36fa,0x2b,
	0x36fb,0x0b,
	0x36fc,0x01,
	0x36fd,0x34,
	0x3900,0x11,
	0x3901,0x05,
	0x3902,0xc5,
	0x3904,0x04,
	0x3908,0x91,
	0x391e,0x00,
	0x3e00,0x00,
	0x3e01,0x57,
	0x3e02,0x00,
	0x3e09,0x20,
	0x3e0e,0xd2,
	0x3e14,0xb0,
	0x3e1e,0x7c,
	0x3e26,0x20,
	0x4418,0x38,
	0x4503,0x10,
	0x4837,0x1a,
	0x5000,0x0e,
	0x540c,0x51,
	0x550f,0x38,
	0x5780,0x67,
	0x5784,0x10,
	0x5785,0x06,
	0x5787,0x02,
	0x5788,0x00,
	0x5789,0x00,
	0x578a,0x02,
	0x578b,0x00,
	0x578c,0x00,
	0x5790,0x00,
	0x5791,0x00,
	0x5792,0x00,
	0x5793,0x00,
	0x5794,0x00,
	0x5795,0x00,
	0x5799,0x04,

	//132gs 896x898
	0x3200,0x00,
	0x3201,0x5c,
	0x3202,0x00,
	0x3203,0xc4,
	0x3204,0x03,
	0x3205,0xfb,
	0x3206,0x04,
	0x3207,0x53,
	0x3208,0x03,
	0x3209,0x80,
	0x320a,0x03,
	0x320b,0x80,
	0x3210,0x00,
	0x3211,0x10,
	0x3212,0x00,
	0x3213,0x08,
#ifdef TRIGGER
	//132gs singel frame slave singel trigger trig-exposure
	0x3222,0x02,
	0x3223,0x48,
	0x3226,0x08,
	0x3227,0x08,
	0x3217,0x00,
	0x3218,0x00,
	0x322b,0x0b,
	0x320e,0x3f,
	0x320f,0xff,
	0x3225,0x04,
	0x300a,0x62,
#endif
	0x36e9,0x54,
	0x36f9,0x50,
	0x0100,0x00,	//we must stream off first.
	0x33fa,0x01,
	0x3317,0xf0,

};

static uint32_t sc132gs_hdr_init_896x896_10fps_setting[] = {
	0x0103,0x01,
	0x0100,0x00,
	0x36e9,0x80,
	0x36f9,0x80,
	0x3018,0x12,
	0x3019,0x0e,
	0x301f,0x47,
	0x3031,0x0a,
	0x3037,0x20,
	0x3200,0x00,
	0x3201,0x04,
	0x3202,0x00,
	0x3203,0x04,
	0x3204,0x05,
	0x3205,0x0b,
	0x3206,0x03,
	0x3207,0xcb,
	0x3208,0x05,
	0x3209,0x00,
	0x320a,0x03,
	0x320b,0xc0,
	0x320c,0x06,
	0x320d,0x72,
	0x320e,0x07,
	0x320f,0xd0,
	0x3210,0x00,
	0x3211,0x04,
	0x3212,0x00,
	0x3213,0x04,
	0x3250,0x3f,
	0x3251,0x98,
	0x3253,0x08,
	0x325f,0x0a,
	0x3281,0x01,
	0x3304,0x40,
	0x3306,0x70,
	0x3309,0x70,
	0x330a,0x01,
	0x330b,0xf0,
	0x330d,0x30,
	0x3310,0x0e,
	0x3314,0x92,
	0x331e,0x31,
	0x331f,0x61,
	0x335d,0x60,
	0x3364,0x5e,
	0x3396,0x08,
	0x3397,0x18,
	0x3398,0x38,
	0x3399,0x0c,
	0x339a,0x10,
	0x339b,0x1e,
	0x339c,0x70,
	0x33af,0x38,
	0x360f,0x21,
	0x3621,0xe8,
	0x3632,0x68,
	0x3633,0x33,
	0x3634,0x23,
	0x3635,0x20,
	0x3637,0x19,
	0x3638,0x08,
	0x363b,0x04,
	0x363c,0x06,
	0x3670,0x42,
	0x3671,0x05,
	0x3672,0x15,
	0x3673,0x15,
	0x3674,0xc0,
	0x3675,0x84,
	0x3676,0x88,
	0x367a,0x48,
	0x367b,0x58,
	0x367c,0x48,
	0x367d,0x58,
	0x3699,0x00,
	0x369a,0x00,
	0x369b,0x1f,
	0x36a2,0x48,
	0x36a3,0x58,
	0x36a6,0x48,
	0x36a7,0x58,
	0x36ab,0xc0,
	0x36ac,0x84,
	0x36ad,0x88,
	0x36d0,0x40,
	0x36db,0x04,
	0x36dc,0x14,
	0x36dd,0x14,
	0x36de,0x48,
	0x36df,0x58,
	0x36ea,0x35,
	0x36eb,0x0c,
	0x36ec,0x05,
	0x36ed,0x24,
	0x36fa,0x35,
	0x36fb,0x15,
	0x36fc,0x10,
	0x36fd,0x34,
	0x3e01,0x74,
	0x3e02,0x00,
	0x3e04,0x07,
	0x3e05,0x40,
	0x3e23,0x00,
	0x3e24,0x7a,
	0x450a,0x71,
	0x4816,0x71,
	0x4819,0x0c,
	0x481b,0x07,
	0x481d,0x1a,
	0x481f,0x05,
	0x4821,0x0c,
	0x4823,0x06,
	0x4825,0x05,
	0x4827,0x06,
	0x4829,0x0a,
	0x578a,0x18,
	0x578b,0x10,
	0x5793,0x18,
	0x5794,0x10,
	0x5799,0x00,
	0x36e9,0x53,
	0x36f9,0x53,
	// 0x0100,0x01,
};

static uint32_t sc132gs_stream_on_setting[] = {
	0x0100,0x01,
};

static uint32_t sc132gs_stream_off_setting[] = {
	0x0100,0x00,
};

static uint32_t sc132gs_gain_lut[] = {
	0x0320,
	0x0321,
	0x0321,
	0x0322,
	0x0323,
	0x0324,
	0x0324,
	0x0325,
	0x0326,
	0x0327,
	0x0328,
	0x0329,
	0x0329,
	0x032A,
	0x032B,
	0x032C,
	0x032D,
	0x032E,
	0x032F,
	0x0330,
	0x0331,
	0x0332,
	0x0334,
	0x0335,
	0x0336,
	0x0337,
	0x0338,
	0x0339,
	0x2320,
	0x2321,
	0x2322,
	0x2323,
	0x2323,
	0x2324,
	0x2325,
	0x2326,
	0x2327,
	0x2327,
	0x2328,
	0x2329,
	0x232A,
	0x232B,
	0x232C,
	0x232D,
	0x232E,
	0x232F,
	0x2330,
	0x2331,
	0x2332,
	0x2333,
	0x2334,
	0x2335,
	0x2336,
	0x2338,
	0x2339,
	0x233A,
	0x233B,
	0x233D,
	0x233E,
	0x233F,
	0x2720,
	0x2721,
	0x2722,
	0x2723,
	0x2723,
	0x2724,
	0x2725,
	0x2726,
	0x2727,
	0x2727,
	0x2728,
	0x2729,
	0x272A,
	0x272B,
	0x272C,
	0x272D,
	0x272E,
	0x272F,
	0x2730,
	0x2731,
	0x2732,
	0x2733,
	0x2734,
	0x2735,
	0x2736,
	0x2738,
	0x2739,
	0x273A,
	0x273B,
	0x273D,
	0x273E,
	0x273F,
	0x2F20,
	0x2F21,
	0x2F22,
	0x2F23,
	0x2F23,
	0x2F24,
	0x2F25,
	0x2F26,
	0x2F27,
	0x2F27,
	0x2F28,
	0x2F29,
	0x2F2A,
	0x2F2B,
	0x2F2C,
	0x2F2D,
	0x2F2E,
	0x2F2F,
	0x2F30,
	0x2F31,
	0x2F32,
	0x2F33,
	0x2F34,
	0x2F35,
	0x2F36,
	0x2F38,
	0x2F39,
	0x2F3A,
	0x2F3B,
	0x2F3D,
	0x2F3E,
	0x2F3F,
	0x3F20,
	0x3F21,
	0x3F22,
	0x3F23,
	0x3F23,
	0x3F24,
	0x3F25,
	0x3F26,
	0x3F27,
	0x3F27,
	0x3F28,
	0x3F29,
	0x3F2A,
	0x3F2B,
	0x3F2C,
	0x3F2D,
	0x3F2E,
	0x3F2F,
	0x3F30,
	0x3F31,
	0x3F32,
	0x3F33,
	0x3F34,
	0x3F35,
	0x3F36,
	0x3F38,
	0x3F39,
	0x3F3A,
	0x3F3B,
	0x3F3D,
	0x3F3E,
	0X3F3F,
};

static uint32_t sc132gs_dgain_lut[] = {
	0x0080,
	0x0084,
	0x0084,
	0x0088,
	0x008C,
	0x0090,
	0x0090,
	0x0094,
	0x0098,
	0x009C,
	0x00A0,
	0x00A4,
	0x00A4,
	0x00A8,
	0x00AC,
	0x00B0,
	0x00B4,
	0x00B8,
	0x00BC,
	0x00C0,
	0x00C4,
	0x00C8,
	0x00D0,
	0x00D4,
	0x00D8,
	0x00DC,
	0x00E0,
	0x00E4,
	0x00EC,
	0x00F0,
	0x00F4,
	0x00FC,
	0x0180,//2.0x
	0x0184,
	0x0184,
	0x0188,
	0x018C,
	0x0190,
	0x0190,
	0x0194,
	0x0198,
	0x019C,
	0x01A0,
	0x01A4,
	0x01A4,
	0x01A8,
	0x01AC,
	0x01B0,
	0x01B4,
	0x01B8,
	0x01BC,
	0x01C0,
	0x01C4,
	0x01C8,
	0x01D0,
	0x01D4,
	0x01D8,
	0x01DC,
	0x01E0,
	0x01E4,
	0x01EC,
	0x01F0,
	0x01F4,
	0x01FC,
	0x0380,//4.0x
	0x0384,
	0x0384,
	0x0388,
	0x038C,
	0x0390,
	0x0390,
	0x0394,
	0x0398,
	0x039C,
	0x03A0,
	0x03A4,
	0x03A4,
	0x03A8,
	0x03AC,
	0x03B0,
	0x03B4,
	0x03B8,
	0x03BC,
	0x03C0,
	0x03C4,
	0x03C8,
	0x03D0,
	0x03D4,
	0x03D8,
	0x03DC,
	0x03E0,
	0x03E4,
	0x03EC,
	0x03F0,
	0x03F4,
	0x03FC,
	0x0780,//8.0x
	0x0784,
	0x0784,
	0x0788,
	0x078C,
	0x0790,
	0x0790,
	0x0794,
	0x0798,
	0x079C,
	0x07A0,
	0x07A4,
	0x07A4,
	0x07A8,
	0x07AC,
	0x07B0,
	0x07B4,
	0x07B8,
	0x07BC,
	0x07C0,
	0x07C4,
	0x07C8,
	0x07CC,
	0x07D4,
	0x07D8,
	0x07DC,
	0x07E0,
	0x07E4,
	0x07EC,
	0x07F0,
	0x07F4,
	0x07FC,
	0x0F80,//16.x
	0x0F84,
	0x0F84,
	0x0F88,
	0x0F8C,
	0x0F90,
	0x0F94,
	0x0F98,
	0x0F9C,
	0x0FA0,
	0x0FA4,
	0x0FA4,
	0x0FA8,
	0x0FAC,
	0x0FB0,
	0x0FB4,
	0x0FB8,
	0x0FBC,
	0x0FC0,
	0x0FC4,
	0x0FC8,
	0x0FD0,
	0x0FD4,
	0x0FD8,
	0x0FDC,
	0x0FE0,
	0x0FE4,
	0x0FEC,
	0x0FF0,
	0x0FF4,
	0x0FFC,
};


#ifdef __cplusplus
}
#endif

#endif  //UTILITY_SENSOR_INC_SC132GS_SETTING_H_
